package com.root.dreameraadmin.view;

import android.support.v7.widget.Toolbar;
import android.widget.TextView;

import com.root.dreameraadmin.utils.APPUtils;


/**
 * Created by lijialin on 2016/9/22.
 */

public class ToolBarView {

    public static void startIntroAnimation(Toolbar toolbar, TextView textView, String string) {
        if(string != ""){
            textView.setText(string);
        }
        int actionbarSize = APPUtils.dpToPx(56);
        if (toolbar != null) {
            toolbar.setTranslationY(-actionbarSize);
            toolbar.animate()
                    .translationY(0)
                    .setDuration(300)
                    .setStartDelay(300);
        }
        if (textView != null) {
            textView.setTranslationY(-actionbarSize);
            textView.animate()
                    .translationY(0)
                    .setDuration(300)
                    .setStartDelay(400);
        }
    }
}
